home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / include / cmodelP.h < prev    next >
C/C++ Source or Header  |  1993-06-09  |  2KB  |  91 lines

  1. #ifndef PMH
  2. #define PMH
  3.  
  4. #include "point3.h"
  5. #include "hpoint3.h"
  6. #include "polylistP.h"
  7. #include "color.h"
  8. #include "vectP.h"
  9. #include "quadP.h"
  10. #include "cmodel.h"
  11.  
  12. /* decls for cmodel_data.c */
  13.  
  14. struct vertex {
  15.    Vertex V, *vxp;
  16.    int visible;
  17.    HPoint3 polar;
  18.    struct vertex *next;
  19.    };
  20.  
  21. struct edge {
  22.    struct vertex *v1, *v2;
  23.    HPoint3 polar;
  24.    int small,     /* says the edge is too short to consider splitting */           
  25.        visible, /* says we should display this edge */
  26.        hascolor,
  27.        split;     /* says we just split this edge, this is one half ...*/
  28.    struct edge *other_half,  /* .. and the other half is here  */
  29.       *next;
  30.    };
  31.  
  32. struct triangle {
  33.    int small,    /* says the triangle has 3 short edges */
  34.       o1, o2, o3;
  35.    struct edge *e1, *e2, *e3;
  36.    Poly *orig_poly;
  37.    Vertex *v[3]; /* only used at the end */
  38.    struct triangle *next;
  39.    };
  40.  
  41. #define edgeBLOCKSIZE 120
  42.  
  43. void initialize_edges();
  44. void clear_all_edges();
  45. struct edge *new_edge(struct vertex *v1, struct vertex *v2, HPoint3 *polar);
  46. struct edge *first_edge();
  47. struct edge *get_last_edge();
  48.  
  49. #define triangleBLOCKSIZE 80
  50.  
  51. int triangle_count();
  52. void initialize_triangles();
  53. void clear_all_triangles();
  54. struct triangle *new_triangle(struct edge *e1, struct edge *e2,
  55.    struct edge *e3, int o1, int o2, int o3, Poly *p);
  56. struct triangle *first_triangle();
  57. struct triangle *get_last_triangle();
  58.  
  59. #define vertexBLOCKSIZE 40
  60.  
  61. void initialize_vertexs();
  62. void clear_all_vertexs();
  63. int vertex_count();
  64. struct vertex *new_vertex(Point3 *pt, struct vertex *v1, struct vertex *v2);
  65. struct vertex *simple_new_vertex(HPoint3 *pt, ColorA *col);
  66. struct vertex *first_vertex();
  67. struct vertex *get_last_vertex();
  68.  
  69. /* decls for cm_geometry.c */
  70.  
  71. /* any function of type "splitfunc" takes an edge, decides whether to 
  72.    split it or not and then returns either a pointer to the midpoint or
  73.    a null pointer.
  74. */
  75. typedef struct vertex *(*splitfunc)(struct edge *e, double cosmaxbend);
  76. void projective_to_conformal(int curv, HPoint3 *proj, Transform T,
  77.                 Point3 *poinc);
  78. void projective_vector_to_conformal(int curv, HPoint3 *pt,  Point3 *v,
  79.                     Transform T, 
  80.                     Point3 *ppt, Point3 *pv);
  81. struct vertex * edge_split(struct edge *e, double cosmaxbend);
  82. void edge_polar_point(int curv, const Point3 *a, const Point3 *b, HPoint3 *p);
  83. void triangle_polar_point(int curv,
  84.               const Point3 *a, const Point3 *b, const Point3 *c, 
  85.               HPoint3 *p);
  86.  
  87. #define FALSE 0
  88. #define TRUE 1
  89.  
  90. #endif
  91.